package STUDENT.TRANDAODAIVI.OOPs.BaitapOOPEX2;

class tamgiac{
	double side1,side2,side3;
	//Construtor:
	public tamgiac(double side1,double side2,double side3){
		this.side1=side1;
		this.side2=side2;
		this.side3=side3;
	}
	//Perimeter
	public double getP(tamgiac abc){
		return side1+side2+side3;
		
	}
	//Area
	public double getS(tamgiac abc){
		double k=(side1+side2+side3)/2;
		return Math.sqrt(k*(k-side1)*(k-side2)*(k-side3));
	}
	//Print
	public void toString(tamgiac abc){
		System.out.println("Tam giac co 3 canh nhu sau: ");
		System.out.println("Side 1= "+side1);
		System.out.println("Side 2= "+side2);
		System.out.println("Side 3= "+side3);
	   
	}
}
public class BT1 {
public static void main(String[] args){
	tamgiac abc=new tamgiac(4,5,5);
	abc.toString(abc);
	System.out.println(abc.getP(abc));
	System.out.println(abc.getS(abc));
}
}
